<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>插槽的基本使用</title>
</head>
<body>
<div id="app">
    <cpn></cpn>

    <hr>

    <cpn>
        <span>Hello, World!</span>
        <div>世界，你好！</div>
        <h3>陕西交通职业技术学院欢迎您！</h3>
    </cpn>
</div>

<template id="cpn">
    <h2>这是一个子组件</h2>
    <h2>下面的内容是调用插槽</h2>
    <slot>
<!--        <button>按钮</button>-->
    </slot>
</template>

<script type="module">
    import {createApp} from "../../../../js/vue.esm-browser.js";
    import {defineComponent} from "../../../../js/vue.esm-browser.js";

    let cpn = defineComponent(
        {
            template: "#cpn",
        }
    );
    let app = createApp({
        setup() {
            return {}
        },
        components: {
            cpn
        }
    })

    app.mount("#app")
</script>
</body>
</html>